package com.ss.android.article.base.feature.update.activity;

import android.content.Context;
import android.os.Bundle;
import android.text.method.MovementMethod;
import android.view.View;
import android.widget.TextView;

import com.bytedance.common.utility.UIUtils;
import com.ss.android.account.Spipe;
import com.ss.android.article.base.feature.update.a.c;
import com.ss.android.article.base.feature.update.b.UpdateItemMgr;
import com.ss.android.article.browser.R;

final class r implements View.OnClickListener {
    private final com.ss.android.article.base.feature.update.activity.g.g$d b;
    private final c a;

    r(com.ss.android.article.base.feature.update.activity.g.g$d arg1, c arg2) {
        this.b = arg1;
        this.a = arg2;

    }

    public final void onClick(View arg8) {
        int v0_2;
        if (this.a != null && this.a.d != null) {
            if (((arg8 instanceof TextView)) && ((((TextView) arg8).getMovementMethod() instanceof t.b))) {
                MovementMethod v0 = ((TextView) arg8).getMovementMethod();
                if (v0 != null) {
                    if (!((t.b) v0).a) {
                    } else {
                        return;
                    }
                }
            }

            if (this.b.e.c != null) {
                if (!this.b.e.c.isLogin) {
                    Bundle v0_1 = android.support.design.a.createJumpData("title_post", "post_comment");
                    Spipe.inst();
                    Spipe.a(this.b.d, v0_1);
                    return;
                } else {
                    if ((this.b.e.c.isLogin) && (this.a.d.hasBlockRelation())) {
                        Context v1 = com.ss.android.article.base.feature.update.activity.g.g$d.e(this.b);
                        int v2 = R.drawable.close_popup_textpage;
                        if (this.a.d.isBlocking()) {
                            v0_2 = R.string.user_toast_has_blocking;
                        } else if (this.a.d.isBlocked()) {
                            v0_2 = R.string.user_toast_has_blocked;
                        } else {
                            v0_2 = 0;
                        }

                        UIUtils.showImageToast(v1, v2, v0_2);
                        return;
                    }

                    if (!this.b.e.c.isLogin) {
                    } else if (this.b.e.c.userId != this.a.d.mUserId) {
                    } else if (this.b.e.m == null) {
                    } else {

                        UpdateItemMgr v2_1 = this.b.e.m;
                        Context v3 = com.ss.android.article.base.feature.update.activity.g.g$d.f(this.b);
                        com.ss.android.article.base.feature.update.a.d v4 = this.b.e.j;
                        c v5 = this.a;
                        int v6 = this.b.e.g;
                        if (v3 == null) {
                            return;
                        }

                        if (v4 == null) {
                            return;
                        }

                        if (v5 == null) {
                            return;
                        }

                        long v0_3 = v5.d != null ? v5.d.userId : 0;
                        if (!v2_1.checkLoginAndNet(v0_3)) {
                            return;
                        }
                        UpdateItemMgr.showDeleteConfirmDialog(v3, new com.ss.android.article.base.feature.update.b.r(v2_1, v6, v4, v5));
                        return;
                    }
                }
            }

            this.b.e.a("reply");
            com.ss.android.article.base.feature.update.a.b v1_1 = new com.ss.android.article.base.feature.update.a.b(this.b.e.d, this.a.d, this.a, "");
            v1_1.h = this.b.e.f;
            this.b.e.a(this.a);
            if (this.b.e.r == null) {
                return;
            }

            this.b.e.r.a(v1_1);
        }
    }
}

